function verifyForm() {
	return true;
}

function buyDirectly() {
	var form = document.getElementById("buyForm");
	form.action = "buyDirectly.do";
	form.submit();
}

function addToCart() {
	var url = "addToCart.do";
	var params = {id:$("#id").val(), quantity:$("#quantity").val()};
	$.post(url, params, addToCartCallback);
}

function addToCartCallback(data, e) {
	var html = '\
		商品已添加至购物车！\
	';
	showMessage(e, html);
}

function switchTab() {
	var detailTab = document.getElementById("detailTab");
	var commentTab = document.getElementById("commentTab");
	var bookDetailInfo = document.getElementById("bookDetailInfo");
	var bookComment = document.getElementById("bookComment");
	if (detailTab.className == "current") {
		detailTab.className = "";
		commentTab.className = "current";
		bookDetailInfo.style.display = "none";
		bookComment.style.display = "block";
	} else {
		detailTab.className = "current";
		commentTab.className = "";
		bookDetailInfo.style.display = "block";
		bookComment.style.display = "none";
	}
}

function comment(){
	var url = "addComment.do";
	var params = {bookID:$("#bookID").attr("value"), comment:$("#comment").val()};
	$.post(url, params, commentCallback);
}

function commentCallback(data) {
	$("#bookComment").html(data);
}
